package com.itheima.exerciseTest.method10_19.method14;

public class Student implements Comparable<Student> {
    private int age;

    public Student() {
    }

    public Student(int age) {
        this.age = age;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    @Override
    public String toString() {
        return "Student{" +
                "age=" + age +
                '}';
    }

    @Override
    public int compareTo(Student s) {
        return this.age - s.age;
    }
}
